package ac.svn.accesscontrol.store;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

public class GroupDetails implements Serializable 
{

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private String 	groupName;
    private String 	groupAlias;
    private String 	lastUpdatedBy = "Admin";
    private Date   	lastUpdated;
    private Date   	createOn;
    private Set<String> memberList;


    public GroupDetails() {
	super();
    }


    public GroupDetails(String groupName, String groupAlias,
	    String lastUpdatedBy, Set<String> memberList) {
	super();
	this.groupName 		= groupName;
	this.groupAlias 	= groupAlias;
	this.lastUpdatedBy 	= lastUpdatedBy;
	this.lastUpdated 	= new Date();
	this.createOn 		= new Date();
	this.memberList 	= memberList;
    }


    public GroupDetails(String groupName, String groupAlias) {
	super();
	this.groupName 		= groupName;
	this.groupAlias 	= groupAlias;
	this.lastUpdated 	= new Date();
	this.createOn 		= new Date();
    }


    public GroupDetails(SVNGroup group) 
    {
	this.groupName 		= group.getGroupName();
	this.groupAlias	 	= group.getGroupAlias();
	this.memberList 	= group.getGroupMembers();
	this.lastUpdated 	= new Date();
	this.createOn 		= new Date();
    }

    public void updateInformation(SVNGroup group)
    {
	this.groupName 		= group.getGroupName();
	this.groupAlias	 	= group.getGroupAlias();
	this.memberList 	= group.getGroupMembers();
	this.lastUpdated 	= new Date();
	this.createOn 		= new Date();
    }


    /**
     * @return the groupName
     */
    public String getGroupName() {
	return groupName;
    }


    /**
     * @param groupName the groupName to set
     */
    public void setGroupName(String groupName) {
	this.groupName = groupName;
    }


    /**
     * @return the groupAlias
     */
    public String getGroupAlias() {
	return groupAlias;
    }


    /**
     * @param groupAlias the groupAlias to set
     */
    public void setGroupAlias(String groupAlias) {
	this.groupAlias = groupAlias;
    }


    /**
     * @return the lastUpdatedBy
     */
    public String getLastUpdatedBy() {
	return lastUpdatedBy;
    }


    /**
     * @param lastUpdatedBy the lastUpdatedBy to set
     */
    public void setLastUpdatedBy(String lastUpdatedBy) {
	this.lastUpdatedBy = lastUpdatedBy;
    }


    /**
     * @return the lastUpdated
     */
    public Date getLastUpdated() {
	return lastUpdated;
    }


    /**
     * @param lastUpdated the lastUpdated to set
     */
    public void setLastUpdated(Date lastUpdated) {
	this.lastUpdated = lastUpdated;
    }


    /**
     * @return the memberList
     */
    public Set<String> getMemberList() {
	return memberList;
    }


    /**
     * @param memberList the memberList to set
     */
    public void setMemberList(Set<String> memberList) {
	this.memberList = memberList;
    }


    /**
     * @return the createOn
     */
    public Date getCreateOn() {
	return createOn;
    }


    /**
     * @param createOn the createOn to set
     */
    public void setCreateOn(Date createOn) {
	this.createOn = createOn;
    }   


    public String getGroupId()
    {
	return groupAlias;
    }
}
